﻿#ifndef _OI_FLANGEXWINDOW_HPP_
#define _OI_FLANGEXWINDOW_HPP_

#include "Appl/OiAppl.hpp"
#include <RibbonControls/RcRibbonMainWindow.hpp>
#include <RibbonControls/RcRibbonBar.hpp>
#include <RibbonControls/RcRibbonQuickAccessBar.hpp>
#include <RibbonControls/RcRibbonQuickActionBar.hpp>

namespace Oi { namespace Appl {

class FlangeXWindow : public Oi::RibbonMainWindow
{
    Q_OBJECT
public:
    FlangeXWindow(QWidget *parent = 0);
    ~FlangeXWindow();

public:
    Q_INVOKABLE QWidget* getOperViewer(QString name) const;
    Q_INVOKABLE QWidget* getHistViewer(QString name) const;
 
public slots:
    void appendHistory(const QString& text);
    void appendWarning(const QString& text);
    void appendMessage(const QString& text);

protected:
    void keyPressEvent(QKeyEvent* evt);
    void keyReleaseEvent(QKeyEvent* evt);
    void closeEvent(QCloseEvent* evt);

signals:
    void enterExecuteProgram();
    void leaveExecuteProgram();

private slots:
    void onDebugger();
    void onPassword();
    void onHelp();
    void onReady();
    void onAbout();
    void onClose();

    void onSwitchTriggered();
    void onRunTriggered();
    void onSettingTriggered();
    void onLoopClicked();
    void onStopClicked();

    void onSelectProduct(const QString& product);
    void onAppendProduct();
    void onModifyProduct(const QString& product);
    void onDeleteProduct(const QString& product);

private:
    OI_DISABLE_COPY(FlangeXWindow);
    OI_DECLARE_IMPL(FlangeXWindow);
};

} }

#endif
